How do I give text or an image a transparent background using CSS?
https://stackoverflow.com/questions/806000/how-do-i-give-text-or-an-image-a-transparent-background-using-css
p {
position: absolute;
background-color: green;
filter: alpha(opacity=60);
opacity: 0.6;
}
span {
color: white;
filter: alpha(opacity=100);
opacity: 1;
}
作者使用了opacity屬性,但這個屬性會造成整個tag透明
如果只是要讓背景透明:直接使用rbg第四個數字更好:
background-color:rgba(255,0,0,0.5);